﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCG.SolarVengeanceEngine.StarShips
{
    public class Refinery : ResourceStarShip
    {
        //constructor
        public Refinery(SVGame game, Player owner, StarSystem origin)
            : base(game, owner, 6, 0, origin)
        {
        }

        //ship name
        public override string Name
        {
            get
            {
                return "Refinery";
            }
        }

        //ship type
        public override StarShipType ShipType
        {
            get
            {
                return StarShipType.Refinery;
            }
        }

        //description
        public override string Description
        {
            get
            {
                return "When Freighters deposit Resources onto a Refinery, the amount is doubled. " +
                    "Resources cannot be removed from a Refinery, but the Refinery can use the Resources to build new StarShips.";
            }
        }

        //accepts resources
        public override bool IsTransportDestination
        {
            get
            {
                return true;
            }
        }

        //primary system mark
        public override string PrimarySystemMark
        {
            get
            {
                if (!DiscoveredByCurrentPlayer)
                    return "";
                else if (ResourcesInt > 0)
                    return "R" + ResourcesInt;
                else
                    return "";
            }
        }

        //can build starships
        public override bool CanExecuteOrder(OrderType ot)
        {
            if (ot == OrderType.ShipBuildStarShip)
                return ResourcesInt > 0;
            else
                return base.CanExecuteOrder(ot);
        }
    }
}
